﻿using BCT.Domains;
using BCT.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace BCT.Api.Controllers
{
    public class OccuManageController : ApiController
    {
        private readonly IOccuManageDomain _occuManageDomain;

        public OccuManageController(OccuManageDomain occuManageDomain)
        {
            _occuManageDomain = occuManageDomain;
        }
        [HttpGet, HttpPost]
        public Response GetOccupationList(RoleAndOccupationModel model)
        {
            var occupationlist = _occuManageDomain.GetOccupationList(model);
            var result = new Response
            {
                data = occupationlist,
        };
            return result;
        }

        [HttpGet, HttpPost]
        public Response GetOccupationSelect()
        {
            var occupationlist = _occuManageDomain.GetOccupationSelect();
            var result = new Response
            {
                data = occupationlist,
            };
            return result;
        }

        [HttpGet,HttpPost]
        public Response GetOccuListByEditRole([FromBody]RoleAndOccupationModel model) {
            var test = _occuManageDomain.GetOccuListByEditRole(model);
            var result = new Response
            {
                data = test
            };
            return result;
        }
    }
}
